package cn.tedu.log.utils;

import lombok.Getter;

@Getter
public enum LogModel {
    ROLE(1, "权限组"),
    MANAGER(2, "管理员"),
    STAFF(3, "员工档案"),
    ATTENDANCE(4, "排班考勤"),
    STUDY(5, "学习资料"),
    NOTICE(6, "公告管理"),
    PROPERTY(7, "资产管理"),
    LOG(8, "操作日志"),
    DEPARTMENT(9, "部门管理");
    // 更多模型...

    // 枚举常量的构造方法应该是私有的
    private LogModel(int id, String description) {
        this.id = id;
        this.description = description;
    }

    // 每个枚举常量的属性
    private final int id;
    private final String description;

    // 可选：提供一个静态方法根据id查找枚举实例
    public static LogModel fromId(int id) {
        for (LogModel model : values()) {
            if (model.getId() == id) {
                return model;
            }
        }
        throw new IllegalArgumentException("未知的model_id: " + id);
    }
}
